package Com.amit.Collection;

import java.util.ArrayList;
import java.util.Iterator;

class Student
{
	int id;
	String name;
	String address;
	
	
	public Student(int id, String name, String address) {
		super();
		this.id = id;
		this.name = name;
		this.address = address;
	}
	
}

public class Lab2 {

	public static void main(String[] args) {
		
		Student s1=new Student(1, "amit", "lko");
		Student s2=new Student(2, "amit1", "lko1");
		Student s3=new Student(3, "amit3", "lko3");
		
ArrayList al=new ArrayList();

al.add(s1);
al.add(s2);
al.add(s3);

Iterator itr=al.iterator();

while(itr.hasNext())
{
	Student s7=(Student) itr.next();
	System.out.println(s7.id+" "+s7.name+" "+s7.address);
	
}

	}

}
